package com.parfinex.java.phase1.module2.task07;

public class Point {
    int x;
    int y;
    Point(){

    }
    Point(int i, int j){
        x=i;
        y=j;
    }
    void show(){
        System.out.println("Point的x轴是："+this.x+"，y轴是："+this.y);
    }
    void up(){
        y-=1;
    }
    void up(int dy){
        y-=dy;
    }
    public static void main(String[] args){
        //1.使用无参方式构造对象并打印特征
        Point p1= new Point();
        p1.show();
        //2.使用有参方式构造对象并打印特征
        Point p2 = new Point(2,3);
        p2.show();
        System.out.println("----------------");
        p2.up();
        p2.show();
        p2.up(2);
        p2.show();
        System.out.println("-------------");
        System.out.println(p2);

    }
}
